package com.hmdp.service.impl;

import com.hmdp.dto.Result;
import com.hmdp.entity.BlogComments;
import com.hmdp.mapper.BlogCommentsMapper;
import com.hmdp.service.IBlogCommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@Service
public class BlogCommentsServiceImpl extends ServiceImpl<BlogCommentsMapper, BlogComments> implements IBlogCommentsService {
    @Autowired
    private BlogCommentsMapper blogCommentsMapper;

    /**
     * 修改功能
     * @param blogComments
     * @return
     */
    private Result updateBlogComment(BlogComments blogComments){
        int i = blogCommentsMapper.updateById(blogComments);
        if (i>0){
            return  Result.ok();
        }
        return Result.fail("修改失败！");
    }
    @Autowired
    private BlogCommentsMapper blogCommentsMapper;

    /**
     * 查询所有
     * @return
     */
    public List<BlogComments> selectAll(){
        List<BlogComments> blogComments = blogCommentsMapper.selectList(null);
        return blogComments;
    }

}
